<template>
  <nuxt-link
    v-if="availableLocales.length"
    :to="switchLocalePath(theLocale.code)"
  >
    <SvgIconTranslate
      class="hover:text-primary-500 Icon Icon-text"
    ></SvgIconTranslate>
  </nuxt-link>
</template>

<script>
import SvgIconTranslate from '~/components/global/svg/SvgIconTranslate'
export default {
  name: 'NcIconSwitchLang',
  components: {
    SvgIconTranslate,
  },
  computed: {
    availableLocales() {
      return this.$i18n.locales.filter((i) => i.code !== this.$i18n.locale)
    },
    theLocale() {
      return this.availableLocales[0]
    },
  },
}
</script>

<style lang="less"></style>
